import 'package:flutter_test/flutter_test.dart';
import 'package:my_flutter_core/my_flutter_core.dart';
import 'package:my_flutter_core/my_flutter_core_platform_interface.dart';
import 'package:my_flutter_core/my_flutter_core_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMyFlutterCorePlatform
    with MockPlatformInterfaceMixin
    implements MyFlutterCorePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final MyFlutterCorePlatform initialPlatform = MyFlutterCorePlatform.instance;

  test('$MethodChannelMyFlutterCore is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMyFlutterCore>());
  });

  test('getPlatformVersion', () async {
    MyFlutterCore myFlutterCorePlugin = MyFlutterCore();
    MockMyFlutterCorePlatform fakePlatform = MockMyFlutterCorePlatform();
    MyFlutterCorePlatform.instance = fakePlatform;

    expect(await myFlutterCorePlugin.getPlatformVersion(), '42');
  });
}
